/*
 * @Author: 高瑞寒 15932717091@163.com
 * @Date: 2022-05-19 14:05:30
 * @LastEditTime: 2022-05-20 10:54:34
 * @LastEditors: 高瑞寒 15932717091@163.com
 * @Description:
 */
import request from '@/utils/request'

// 获取文章排名
export const getArticleRanking = (params) => {
  return request({
    url: '/article/list',
    method: 'GET',
    params
  })
}
// 修改文章排名
export const updateArticleRanking = (data) => {
  return request({
    url: '/article/sort',
    method: 'POST',
    data
  })
}
// 查看文章详情
export const getArticleDetail = (id) => {
  return request({
    url: `/article/${id}`
  })
}
// 删除文章
export const deleteArticle = (id) => {
  return request({
    url: `/article/delete/${id}`
  })
}
// 创建文章
export const createArticle = (data) => {
  return request({
    url: '/article/create',
    method: 'POST',
    data
  })
}
// 编辑文章
export const editArticle = (data) => {
  return request({
    url: '/article/edit',
    method: 'POST',
    data
  })
}
